package com.jyu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jyu.dao.GroupDao;
import com.jyu.domain.Group;
import com.jyu.domain.Position;
import com.jyu.service.GroupService;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class GroupServiceImpl extends ServiceImpl<GroupDao, Group> implements GroupService {

    @Autowired
    private GroupDao groupDao;

    @Override
    public boolean check(Group group){
        return groupDao.updateById(group) > 0;
    }

    @Override
    public IPage<Group> getPage(int currentPage, int pageSize, Group group) {
        LambdaQueryWrapper<Group> lqw = new LambdaQueryWrapper<Group>();

        IPage page = new Page(currentPage, pageSize);
        groupDao.selectPage(page, lqw);
        return page;
    }
}
